home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tricks of the Mac Game Programming Gurus
/
TricksOfTheMacGameProgrammingGurus.iso
/
More Source
/
Libraries
/
SAT 2.3b4
/
Tutorial ƒ
/
Assignment3.p
< prev
next >
Wrap
Text File
|
1995-01-16
|
761b
|
39 lines
program Assignment3;
uses
{$ifc UNDEFINED THINK_PASCAL}
Types, QuickDraw, Menus, Windows, TextEdit, Fonts, Dialogs, Memory, OSEvents, {}
{$endc}
SAT;
var
ignore: SpritePtr;
var
direction: Integer;
procedure HandleSprite (me: SpritePtr);
begin
me^.position.h := me^.position.h + direction;
if me^.position.h <= 0 then
direction := 1;
if me^.position.h >= 200 then
direction := -1;
end; {HandleSprite}
procedure SetupSprite (me: SpritePtr);
begin
me^.task := @HandleSprite;
me^.face := SATGetFace(128);
direction := 1;
end; {SetupSprite}
begin
{$ifc UNDEFINED THINK_PASCAL}
SATInitToolbox;
{$endc}
SATInit(128, 129, 478, 302);
ignore := SATNewSprite(0, 200, 200, @SetupSprite);
while not Button do
SATRun(true);
end.